Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix SMAC and use system_attrs #176

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

nabenabe0928
Copy link
Contributor

  • Fix an error in SMACSampler
  • Use system_attrs

Please check with the following:

from __future__ import annotations

import optuna
import optunahub


def objective(trial: optuna.Trial) -> float:
    x = trial.suggest_float("x", -5, 5)
    y = trial.suggest_float("y", -5, 5)
    return x**2 + y**2


search_space = {
    "x": optuna.distributions.FloatDistribution(-5, 5),
    "y": optuna.distributions.FloatDistribution(-5, 5),
}
package_name = "samplers/smac_sampler"
sampler = optunahub.load_module(
    package=package_name, repo_owner="nabenabe0928", ref="hotfix-smac"
).SMACSampler(search_space=search_space)
study = optuna.create_study(sampler=sampler)
study.optimize(objective, n_trials=30)
print(study.best_trials)

@nabenabe0928
Copy link
Contributor Author

@y0z
Could you review this PR?

Copy link
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@y0z y0z merged commit 983540a into optuna:main Nov 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants